package edu.yngsxy.wkstudy.core.sys.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import edu.yngsxy.wkstudy.core.model.entity.WkBaseEntity;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;
import jakarta.validation.constraints.*;
import io.swagger.v3.oas.annotations.media.Schema;
/**
 * <p>
 * 试题表
 * </p>
 *
 * @author group 2
 * @since 2025-09-09
 */
@Getter
@Setter
@ToString
@TableName("question")
@Accessors(chain = true)
@Schema(description = "试题表")
public class Question extends WkBaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 试题ID
     */
    @TableField(value = "question_id")
    @Schema(title = "试题ID", description = "试题ID", requiredMode =Schema.RequiredMode.REQUIRED)
    @NotNull(message = "试题ID不能为空")
    private Integer questionId;

    /**
     * 试题内容
     */
    @TableField("content")
    @Schema(title = "试题内容", description = "试题内容", requiredMode =Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "试题内容不能为空")
    @Size(max = 65535, message = "试题内容长度不能超过65,535个字符")
    private String content;

    /**
     * 答案
     */
    @TableField("answer")
    @Schema(title = "答案", description = "答案", requiredMode =Schema.RequiredMode.NOT_REQUIRED)
    @Size(max = 65535, message = "答案长度不能超过65,535个字符")
    private String answer;

    /**
     * 试题分类ID（外键，关联QuestionCategory）
     */
    @TableField("category_id")
    @Schema(title = "试题分类ID（外键，关联QuestionCategory）", description = "试题分类ID（外键，关联QuestionCategory）", requiredMode =Schema.RequiredMode.NOT_REQUIRED)
    private Integer categoryId;

    /**
     * 试题标签ID（外键，关联QuestionTag）
     */
    @TableField("tag_id")
    @Schema(title = "试题标签ID（外键，关联QuestionTag）", description = "试题标签ID（外键，关联QuestionTag）", requiredMode =Schema.RequiredMode.NOT_REQUIRED)
    private Integer tagId;

    /**
     * 试题类型ID（外键，关联QuestionType）
     */
    @TableField("type_id")
    @Schema(title = "试题类型ID（外键，关联QuestionType）", description = "试题类型ID（外键，关联QuestionType）", requiredMode =Schema.RequiredMode.NOT_REQUIRED)
    private Integer typeId;
}
